package com.wxyzz.satserver.visit.controller;

import com.wxyzz.common.core.common.R;


import com.wxyzz.satserver.visit.VO.InteractInfoVO;
import com.wxyzz.satserver.visit.VO.VisitVO;
import com.wxyzz.satserver.visit.param.AddVisitParam;
import com.wxyzz.satserver.visit.service.VisitService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * --- 加油，努力 ---
 *
 * @Author XYP
 * @Date 2024/11/16
 * @Solgne 从想做到能做
 * @Desc
 */
@RestController
@RequestMapping("/visit")
@Api(tags ="访问api")
@CrossOrigin
public class VisitController {

    @Resource
    private VisitService visitService;

    @GetMapping("/addVisit")
    @ApiOperation(value = "访问用户")
    public R addVisit(Integer beVisitorId) {
        visitService.addVisit(beVisitorId);
        return R.ok();
    }

    @GetMapping("/visitors")
    @ApiOperation(value = "谁访问了我")
    public R getVisitors() {
        List<VisitVO> visitVOS = visitService.selectVisitor();
        return R.ok(visitVOS);
    }

    @GetMapping("/interactInfo")
    @ApiOperation(value= "消息中的互动通知，谁评论了我的动态")
    public R interactInfo(){
        InteractInfoVO interactInfo = visitService.findInteractInfo();
        return R.ok(interactInfo);
    }
}
